import { combineReducers } from '@reduxjs/toolkit';

import counterReducer from '@/features/counter/counterSlice';
import authReducer from '@/features/auth/authSlice';
import queryReducer from '@/pages/query/indexSlice';
import TicketReducer from '@/pages/ticket/indexSlice';
import OrderReducer from '@/pages/order/indexSlice';
import LoginReducer from '@/pages/login/indexSlice';
import { baseApi } from '@/api/base';
import { baseApi1 } from '@/api/authBase';

const rootReducer = combineReducers({
  counter: counterReducer,
  auth: authReducer,
  query: queryReducer,
  ticket: TicketReducer,
  order: OrderReducer,
  loginInfo: LoginReducer,
  [baseApi.reducerPath]: baseApi.reducer,
  [baseApi1.reducerPath]: baseApi1.reducer,
});

export const apis = [baseApi.middleware, baseApi1.middleware];

export default rootReducer;
